Settings for Alert Configuration |
|
This topic contains information on how an administrator can configure the alert system for filters and appenders by modifying the settings in the configuration file.
The configuration file contains settings for configuring filters, appenders and priority (severity levels). Based on the values specified in this file, Alert System initialization is carried out. There is a common configuration file defined for both alert and logging, by the name Log4jConfiguration.xml which is located at <Process_Platform_Installation_Directory>/config.
The '<category> node with the name com.eibus.management.AlertSystem' is mandatory to define Alert Configuration in Log4jConfiguration.xml.
The configuration specified in Log4jConfiguration.xml defines the behavior of alert system. The structure of an alert configuration is as shown below:
<category name='com.eibus.management.AlertSystem' additivity='true'> <priority value='info' /> <appender-ref ref=' alertfile' /> </category> <appender class='com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender' name='alertfile'> <param name='File' value='%N.xml' /> <param name='DatePattern' value=".'yyyy-MM-dd" /> <layout class='org.apache.log4j.xml.XMLLayout' /> </appender>
Note: By default, during installation the installer configures alert and logging with default values. The default configuration looks like this:
<category name='com.eibus.management.AlertSystem'> <priority value='info'/> <appender-ref ref="OSBasedEventAppender"/> </category> <appender name="OSBasedEventAppender"> <layout> <param name="LocationInfo" value="true"/> </layout> </appender>
This implies that the consumers or appenders for both logging as well as alerts will be same. All the parameters required for an alert system must be defined under <category>. These parameters include the consumers or appenders, filters and severity levels. Elements used in the configuration file are explained as follows:
Element |
Description |
---|---|
category |
This has the name attribute and represents the fully qualified class name of the Alert System. The default value of 'additivity' attribute is 'true' and if it is set to 'false' for a logger, prevents parents of that logger from using their appenders. For more details see here. |
priority |
This represents the type or level of message to be issued. The 'value' attribute can be used to specify the type and its hierarchy.
|
appender |
Appenders are consumers to which the alert messages must be sent. These can be specified using the 'class' attribute, in which the fully qualified class name of the consumer must be defined. Example, <appender class='com.eibus.util.logger.appender. ProcessNamedDailyRollingFileAppender' name='alertfile'> Alert system can be configured to various consumers such as the File, E-Mail, Syslog, Windows Event Log and so on. |
filter |
A filter is used to filter the alerts based on alert or message ids and is specific to a particular appender. This must be mentioned inside the corresponding appender. Example, <filter class ='com.eibus.util.logger.filter. ResourceIDFilter'> |
<appender-ref> |
This element allows referencing another appender by its name. The ref attribute must match the name of appender declared elsewhere within an <appender> element. |
All alert and log messages are sent to a single file for processing. However, you can choose to publish alert messages to a different file. In such a case, the configuration should be done as shown below:
<category name='com.eibus.management.AlertSystem' additivity='false'> <priority value='info' /> <appender-ref ref=' alertfile' /> </category> <appender class='com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender' name='alertfile'> <param name='File' value='Alert_%N.xml' /> <param name='DatePattern' value=".'yyyy-MM-dd" /> <layout class='org.apache.log4j.xml.XMLLayout' /> </appender>
In the above configuration, alerts would get published to a file name with a prefix 'Alert_'. The changes made in the configuration file are automatically updated to Alert System.